|
|
|
|
|
|
|
Adding the SQLVBMain Code |
|
|
|
|
|
|
|
|
Now that you have created all three forms, you can go back to SQLVBMain and add the code behind the menu options. This is also the time when you add code that calls the Windows Notepad program from within SQLVB. |
|
|
|
|
|
|
|
|
First, add the code from Listing A.8. This arranges the command button bar on the top of the form. |
|
|
|
|
|
|
|
|
Listing A.8. Coding the LoadCmdBtns subroutine. |
|
|
|
|
|
|
|
|
Public Sub LoadCmdBtns()
'
Dim Top As Integer
Dim Left As Integer
Dim Width As Integer
Dim Height As Integer
'
Top = 45
Height = Picture1.Height * 0.75
Width = Height * 1.1
'
For x = 0 To 5
cmdBtn(x).Top = Top
cmdBtn(x).Left = (x * Width) + 45
cmdBtn(x).Width = Width * 0.9
cmdBtn(x).Height = Height
cmdBtn(x).BevelWidth = 2
cmdBtn(x).RoundedCorners = False
Next
'
cmdBtn(0).Picture = LoadPicture(App.Path & "\pics\new.bmp")
cmdBtn(1).Picture = LoadPicture(App.Path & "\pics\open.bmp")
cmdBtn(2).Picture = LoadPicture(App.Path & "\pics\save.bmp")
cmdBtn(3).Picture = LoadPicture(App.Path & "\pics\sum.bmp")
cmdBtn(4).Picture = LoadPicture(App.Path & "\pics\camera.bmp")
cmdBtn(5).Picture = LoadPicture(App.Path & "\pics\undo.bmp")
'
cmdBtn(0).ToolTipText = "New"
cmdBtn(1).ToolTipText = "Edit"
cmdBtn(2).ToolTipText = "Close"
cmdBtn(3).ToolTipText = "Generate"
cmdBtn(4).ToolTipText = "Run"
cmdBtn(5).ToolTipText = "Exit"
'
End Sub |
|
|
|
|
|
|
|
|
Note that this routine sets the picture, tool tip, size, and actual position of each of the command bar buttons. |
|
|
|
|
|